import 'package:flutter/material.dart';
import '../../common/widgets.dart';

class SecondListPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('列表页第二页'),
      ),
      body: Center(
        child: ListView.builder(
          padding: const EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0, bottom: 8.0),
          itemBuilder: _buildListItem,
        ),
      ),
    );
  }

  Widget _buildListItem(BuildContext context, int index) {
    return (index == 0)
        ? buildEntryButton(
            context,
            '跳转下一页',
            '/list_page_test/third_page',
          )
        : buildListItem(index - 1);
  }
}
